package com.junmeng.afloatingball

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import com.junmeng.afloatingball.databinding.ActivityMainBinding
import com.junmeng.libfloating.base.FloatingManager

class MainActivity : AppCompatActivity() {
    lateinit var mBinding: ActivityMainBinding
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        mBinding = ActivityMainBinding.inflate(layoutInflater)
        setContentView(mBinding.root)
    }

    fun onClickShowFloating(view: View) {
        FloatingManager.getInstance().getFloatingBall()?.show()
    }

    fun onClickHideFloating(view: View) {
        FloatingManager.getInstance().getFloatingBall()?.hide()
    }

    fun onClickEnterActivity2(view: View) {
        val intent = Intent(this, MainActivity2::class.java)
        startActivity(intent)
    }

    fun onClickRemoveFloating(view: View) {
        FloatingManager.getInstance().getFloatingBall()?.remove()
    }


}